<?php
namespace app\index\controller;
use think\Config;
use think\Db;

class Index extends Common
{
	//搜索
	public function search()
	{
		$url=Config::get("block_url");
		
		$content=request()->param('content');
		
		//空数值返回
		if(empty($content))
		{
			$this->redirect("Index");
		}
		
		//纯数字 高度
		if(is_numeric($content))
		{
			$this->redirect("Tipset/Detail",['id'=>$content]);
		}
		
		//62位  消息
		if(strlen($content)==12)
		{
			$this->redirect("Block/Index",['cid'=>$content]);
		}
		
		
		//86位 8位 地址 
		if(strlen($content)==86 | strlen($content)==8)
		{
			$this->redirect("Address/index",['address'=>$content]);
		}
		
		
		
		$this->redirect("Index");
		exit;
		
		$this->assign("str","请输入正确的区块,账户或hash");
		return $this->fetch('index/error');
	}
	
	
	
}